#ifndef COMMON_ITERATORPTR_H
#define COMMON_ITERATORPTR_H

#include "Common/Collections/IIterator.h"

template <class Item>
class IteratorPtr{
public:
	IteratorPtr(IIterator<Item>* iterator):
		_iterator(iterator)
	{}

	~IteratorPtr() { delete _iterator;}

	IIterator<Item>* operator->() {return _iterator; }
	IIterator<Item>& operator*() {return *_iterator; }

private:
	IteratorPtr(const IteratorPtr&);
	IteratorPtr& operator= (const IteratorPtr&);

	IIterator<Item>* _iterator;
};

#endif
